/*package br.fbc.servlet;

import java.io.IOException;
import java.util.Map;
import java.util.Set;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.google.code.facebookapi.FacebookException;
import com.google.code.facebookapi.FacebookJsonRestClient;
import com.google.code.facebookapi.FacebookWebappHelper;
import com.google.code.facebookapi.Permission;

public class TesteServlet extends HttpServlet{

	private FacebookWebappHelper<Object> facebookAppHelp;
	private FacebookJsonRestClient facebookClient;
	private HttpServletRequest request;
	
	
	protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
			
			String locale = request.getParameter("fb_sig_locale");
			System.out.println(locale);
			String id = request.getParameter("fb_sig_user");
			
			if (id == null) {
				
				System.out.println("facebook id null");
				
				response.getWriter().print("<fb:redirect url='https://graph.facebook.com/oauth/authorize?client_id=197076857009077&redirect_uri=http://apps.facebook.com/localfred/&scope=email,publish_stream,user_location' />");
			
			} else {
				
				System.out.println("ID: " + id );
				
				facebookAppHelp = FacebookWebappHelper.newInstanceJson(request, response, "197076857009077", "32123fd0c9c512bd03814a0e34732359");
				facebookClient = (FacebookJsonRestClient) facebookAppHelp.getFacebookRestClient();
			
				try {
					if(facebookClient.users_hasAppPermission(Permission.PUBLISH_STREAM)) {
						facebookClient.users_setStatus("Criando uma super applicação pro face, aguarde!!!", Long.parseLong(id));
					}
				} catch (FacebookException e) {
					e.printStackTrace();
				}
			
			}
			
//			
//			
//			
//			facebookAppHelp = FacebookWebappHelper.newInstanceJson(request, response, "197076857009077", "32123fd0c9c512bd03814a0e34732359");
//			facebookClient = (FacebookJsonRestClient) facebookAppHelp.getFacebookRestClient();
//			
//			facebookClient.user
//			
//			RequestDispatcher dispacher =getServletContext().getRequestDispatcher("/index.jsp");
//			dispacher.forward(request, response);
	}		
	
}
*/